package item.inkcloud.distributionservice.service;


import item.inkcloud.distributionservice.mapper.ChangeUserCountMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class ChangeUserCountService {

    @Autowired
    ChangeUserCountMapper changeUserCountMapper;

    public int addUserCount(String province){

        try {
          changeUserCountMapper.addCount(province);
          return 1;

        }catch (Exception e){
          return 0;
        }
    }



    public int exchangeProvince(String oldProvince, String newProvince){

        try {
            changeUserCountMapper.reduceCount(oldProvince);
            changeUserCountMapper.addCount(newProvince);
            return 1;
        }catch (Exception e){

            return 0;
        }





    }


}
